/* 弹幕系统通用样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 10px 0 0 0;
}

/* 弹幕显示区域 */
.barrage-display {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #333;
}

.barrage-item {
    position: absolute;
    white-space: nowrap;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
    transition: transform 0.2s;
}

/* 控制面板 */
.control-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.input-group input, 
.input-group select, 
.input-group button {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input {
    flex: 1;
    min-width: 200px;
}

.input-group button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-width: 100px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.input-group button:active {
    transform: translateY(0);
}

.color-preview {
    width: 40px;
    height: 40px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: transform 0.2s;
}

.color-preview:hover {
    transform: scale(1.1);
}

/* 状态显示 */
.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.disconnected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connecting {
    background-color: #cce7ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* 统计信息 */
.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .barrage-display {
        height: 300px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input,
    .input-group select,
    .input-group button {
        width: 100%;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.barrage-item {
    animation: fadeIn 0.3s ease-out;
}